package com.ljfiction.book.adapter;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ljfiction.book.Baner.SketchBean;
import com.ljfiction.book.R;

import java.util.List;

/**
 * Created by Android on 2017/11/13.
 */

public class SketchAdapter extends BaseQuickAdapter<SketchBean.DataBean.ResultListBean, BaseViewHolder> {
    public SketchAdapter(@LayoutRes int layoutResId, @Nullable List<SketchBean.DataBean.ResultListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SketchBean.DataBean.ResultListBean item) {
        helper.setText(R.id.chaptertitle_sketch, item.getChapterTitle())
                .setText(R.id.zishu_sketchtext, String.valueOf(item.getChapterLength())+ "字")
                .setText(R.id.booktitle_sketch, "《"+item.getBookTitle()+"》");
    }
}
